package com.qige.homework;

import java.util.Arrays;

public class homework10 {
    public static void main(String[] args) {
        String abc = "342567891";
        int[] arr = new int[abc.length()];
        for (int i = 0 ; i < abc.length() ; i++){
            arr[i] = Integer.parseInt(String.valueOf(abc.charAt(i)));
        }
        for (int i = 0; i < arr.length; i++) {
            boolean flag = false;
            for (int j = 0; j < arr.length - i - 1; j++) {
                if (arr[j] > arr[j+1]){
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                    flag = true;
                }
            }
            if (flag){
                break;
            }
        }
    }
}
